home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / SoundAndMusic / cmix / lib / oscilni.c < prev    next >
Text File  |  1989-02-25  |  355b  |  17 lines

  1. float oscilni(amp,si,farray,len,phs)      
  2. float amp,si,*farray,*phs;
  3. register len;
  4. {
  5.     register i =  *phs;         
  6.         register k =  (i + 1) % len; 
  7.     float frac = *phs  - i;       
  8.     *phs += si;         
  9.     while(*phs >= len)
  10.         *phs -= len;  
  11.     while(*phs < 0)
  12.         *phs += len;
  13.     return((*(farray+i) + (*(farray+k) - *(farray+i)) *
  14.                        frac) * amp);
  15.  
  16. }
  17.